package com.itheima;

import com.itheima.aop.RecordLogAspect;
import com.itheima.service.LogPrintService;
import com.itheima.service.impl.ConsoleLogPrintService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RecordLogAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public LogPrintService consoleLogPrintService(){
        return new ConsoleLogPrintService();
    }
    @Bean
    public RecordLogAspect recordLogAspect(){
        return new RecordLogAspect();
    }
}
